

var regexAndroid = function () {
    if (window.jsInterface) {
        return /(Android)/i.test(navigator.userAgent)
    } else {
        return false
    }
}
var appData = function () {
    if (process.env.NODE_ENV !== 'production') {
        return {
            getUserSn: "955a0dbf68e8c3153388990a835c68f6",
            getToken: "911b56f7d98cd2133bd8e88515255fa9",
            getUserId: "173691",
            mobile: "18688728158"
        }
    } else {
        return {
            getUserSn: true,
            getToken: true,
            getUserId: true
        }
    }
}

//获取userSn
export function userSn() {
    if (regexAndroid()) {
        return window.jsInterface.getUserSn();
    } else {
        return appData().getUserSn
    }
}
//获取token
export function getToken() {
    if (regexAndroid()) {
        return window.jsInterface.getToken();
    } else {
        return appData().getToken
    }
}
//获取UserId
export function getUserId() {
    if (regexAndroid()) {
        return window.jsInterface.getUserId();
    } else {
        return appData().getUserId
    }
}
//获取电话号码
export function mobile() {
    if (regexAndroid()) {
        return window.jsInterface.getMobile();
    } else {
        return appData().mobile
    }
}
//返回上一页
export function onBackPressed() {
    if (regexAndroid()) {
        return window.jsInterface.onBackPressed();
    } else {
        return window.history.go(-1)
    }
}
//跳转指定页面id:
//0:分享页面
export function toSpecifyPage(id) {
    if (regexAndroid()) {
        return window.jsInterface.tabSpecifyActivity(id);
    } else {
        return id
    }
}
//获取相册
export function openAlbum(number) {
    if (regexAndroid()) {
        return window.jsInterface.openAlbum(number);;
    } else {
        return ''
    }
}
//拨打电话
export function serveTel(tel) {
    if (regexAndroid()) {
        return window.jsInterface.serveTel(tel);
    } else {
        return ''
    }
}

//看广告
//游戏试玩
export function toGame() {
    if (regexAndroid()) {
        return window.jsInterface.toGame()
    } else {
        return ''
    }
}
//任务墙
export function toTaskList() {
    if (regexAndroid()) {
        return window.jsInterface.toTaskList()
    } else {
        return ''
    }
}
//激励视频
export function showReward() {
    if (regexAndroid()) {
        return window.jsInterface.showReward()
    } else {
        return ''
    }
}
//加速包去看完成视频
export function watchVideo() {
    if (regexAndroid()) {
        return window.jsInterface.watchVideo()
    } else {
        return ''
    }
}



